package com.beta.util;

public class Response
{
  private String data;
  private byte[] responseBytes;
  private String responseString;
  private String sw;

  public Response(byte[] paramArrayOfByte)
  {
    this.responseBytes = paramArrayOfByte;
    this.responseString = HexUtil.encode(this.responseBytes);
    if (this.responseString.length() >= 4)
    {
      this.sw = this.responseString.substring(-4 + this.responseString.length());
      this.data = this.responseString.substring(0, -4 + this.responseString.length());
    }
  }

  public String getData()
  {
    return this.data;
  }

  public byte[] getResponseBytes()
  {
    return this.responseBytes;
  }

  public String getResponseString()
  {
    return this.responseString;
  }

  public String getSw()
  {
    return this.sw;
  }

  public boolean isResultSuccess()
  {
    if(responseString.length()>4){
    	if(responseString.substring(responseString.length()-4).equals("9000")){
    		return true;
    	}
    }
    return false;
  }

  public String toString()
  {
    return this.responseString;
  }
}